<template>
	<view class="main">
		<view class="card flex flex-jc-sb" @click="skip('/pages_me/setting/accountManagement')">
			<view>账号管理</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
		<view class="card flex flex-jc-sb">
			<view>账号管理</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
	</view>
	<view class="main">
		<view class="card flex flex-jc-sb">
			<view>屏蔽设置</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
		<view class="card flex flex-jc-sb">
			<view>隐私设置</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
	</view>
	<view class="main">
		<view class="card flex flex-jc-sb">
			<view>通用设置</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
		<view class="card flex flex-jc-sb">
			<view>关于book</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
	</view>
	<view class="main">
		<view class="card flex flex-jc-sb">
			<view>清除缓存</view>
			<view>
				<u-icon name="arrow-right" color="gainsboro"></u-icon>
			</view>
		</view>
	</view>
	<!-- #ifdef MP-WEIXIN | APP-PLUS -->
	<view class="main">
		<view class="card flex flex-jc-c">
			<!-- #ifdef MP-WEIXIN -->
			<navigator target="miniProgram" open-type="exit">退出book</navigator>
			<!-- #endif -->
			<!-- #ifdef APP-PLUS -->
			<view @click="exit">退出book</view>
			<!-- #endif -->
		</view>
	</view>
	<!-- #endif -->
</template>

<script lang="ts" setup>
	const exit = () =>{
		let system = uni.getSystemInfoSync() // 获取系统信息
		if (system.platform === 'ios') {
			const threadClass = plus.ios.importClass("NSThread");
			const mainThread = plus.ios.invoke(threadClass, "mainThread");
			plus.ios.invoke(mainThread, "exit");
			//上面的不行就用下面的
			plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
		}else{
			plus.runtime.quit(); 
		}
	}
	const skip = (str: string,type: Boolean = false) => {
		if(type) {
			uni.redirectTo({
				url: str,
			})
		}else{
			uni.navigateTo({
				url: str
			})
		}
		
	}
</script>

<style lang="scss" scoped>
	page{
		height: 100%;
		background-color: gainsboro;
	}
	.main{
		margin-top: 30rpx;
	}
	.card{
		border-bottom: 1px solid gainsboro;
		padding: 30rpx;
		background-color: #fff;
	}
</style>